package model;

import java.util.Date;

public class BookDetailsDTO {

	private int bookingID;
	private String emergency;
	private String priority;
	private Date fromDate;
	private Date toDate;
	private String reason;
	private String facilityName;
	private Date bookedOn;
	private int bookedBy;
	private String status;
	private int modifiedBy;
	private Date modifiedOn;
	private String comment;
	
	public int getBookingID() {
		return bookingID;
	}
	public void setBookingID(int bookingID) {
		this.bookingID = bookingID;
	}
	public String getEmergency() {
		return emergency;
	}
	public void setEmergency(String emergency) {
		this.emergency = emergency;
	}
	public String getPriority() {
		return priority;
	}
	public void setPriority(String priority) {
		this.priority = priority;
	}
	public Date getFromDate() {
		return fromDate;
	}
	public void setFromDate(Date fromDate) {
		this.fromDate = fromDate;
	}
	public Date getToDate() {
		return toDate;
	}
	public void setToDate(Date toDate) {
		this.toDate = toDate;
	}
	public String getReason() {
		return reason;
	}
	public void setReason(String reason) {
		this.reason = reason;
	}
	public String getFacilityName() {
		return facilityName;
	}
	public void setFacilityName(String facilityName) {
		this.facilityName = facilityName;
	}
	public Date getBookedOn() {
		return bookedOn;
	}
	public void setBookedOn(Date bookedOn) {
		this.bookedOn = bookedOn;
	}
	public int getBookedBy() {
		return bookedBy;
	}
	public void setBookedBy(int bookedBy) {
		this.bookedBy = bookedBy;
	}
	public String getStatus() {
		return status;
	}
	public void setStatus(String status) {
		this.status = status;
	}
	public int getModifiedBy() {
		return modifiedBy;
	}
	public void setModifiedBy(int modifiedBy) {
		this.modifiedBy = modifiedBy;
	}
	public Date getModifiedOn() {
		return modifiedOn;
	}
	public void setModifiedOn(Date modifiedOn) {
		this.modifiedOn = modifiedOn;
	}
	
	public String getComment() {
		return comment;
	}
	public void setComment(String comment) {
		this.comment = comment;
	}
	
	public boolean overlaps(BookDetailsDTO other){
		boolean flag = true;
		if(this.facilityName!=other.facilityName){
			flag=false;
		}
		else if(fromDate.after(other.getToDate())){
			flag=false;
		}
		else if (other.getFromDate().after(toDate)){
			flag=false;
		}
			return flag;
	}
	@Override
	public String toString() {
		return "BookDetailsDTO [bookingID=" + bookingID + ", emergency="
				+ emergency + ", priority=" + priority + ", fromDate="
				+ fromDate + ", toDate=" + toDate + ", reason=" + reason
				+ ", facilityName=" + facilityName + ", bookedOn=" + bookedOn
				+ ", bookedBy=" + bookedBy + ", status=" + status
				+ ", modifiedBy=" + modifiedBy + ", modifiedOn=" + modifiedOn
				+ ", comment=" + comment + "]";
		}
	
	}
	
